add the postgres addon if no DATABASE_URL is known.

Andrew Cantino 10 years ago
parent
commit
cf5aaf5646
1 changed files with 7 additions and 1 deletions
  1. 7 1
      bin/setup_heroku

+ 7 - 1
bin/setup_heroku

@@ -81,10 +81,16 @@ unless $config['DOMAIN']
81 81
   first_time = true
82 82
 end
83 83
 
84
-set_value 'BUILDPACK_URL', "https://github.com/ddollar/heroku-buildpack-multi.git"
84
+set_value 'BUILDPACK_URL', "https://github.com/heroku/heroku-buildpack-multi.git"
85 85
 set_value 'PROCFILE_PATH', "deployment/heroku/Procfile.heroku", force: false
86 86
 set_value 'ON_HEROKU', "true"
87 87
 
88
+unless $config['DATABASE_URL']
89
+  puts "Setting up the postgres addon"
90
+  puts capture("heroku addons:add heroku-postgresql")
91
+  puts
92
+end
93
+
88 94
 unless $config['SMTP_DOMAIN'] && $config['SMTP_USER_NAME'] && $config['SMTP_PASSWORD'] && $config['SMTP_SERVER'] && $config['EMAIL_FROM_ADDRESS']
89 95
   puts "Okay, let's setup outgoing email settings.  The simplest solution is to use the free sendgrid Heroku addon."
90 96
   puts "If you'd like to use your own server, or your Gmail account, please see .env.example and set"